home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 9
/
FM Towns Free Software Collection 9.iso
/
t_os
/
tool
/
wings
/
w2_src
/
test_2.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-11-16
|
2KB
|
88 lines
// 12ドットフォント・テストプログラム
#include <egb.h>
#include <fnt.h>
#include <conio.h>
#include <stdio.h>
#include <string.h>
void En_font( int x, int y, char *s );
char egbwork[EgbWorkSize], buff[ 110592 ];
void main( void )
{
FILE *fp;
// 12ドットフォントデータを読み込む
fp = fopen( "d:\\sysinit\\system.fnt", "rb" );
fread( buff, 1, 110592, fp );
fclose( fp );
EGB_init( egbwork, 1536 );
// 以下12ドットフォントの表示
En_font( 0, 0, "愛圧悪鮎逢綾庵飴宛葦" );
En_font( 0, 1, "、。,.・:;?!”" );
En_font( 0, 2, "012345ABCF" );
En_font( 0, 3, "あいうえおかきくけし" );
En_font( 0, 4, "アイウエオカキクケシ" );
En_font( 0, 5, "◆□■▽▼※〒→↓〓" );
En_font( 0, 6, "ΑΒΓΔΕΖΗΘΙΚ" );
En_font( 0, 7, "АБВГДЕЁЖЗИ" );
while( !_kbhit( ) );
}
void En_font( int x, int y, char *s )
{
int i = 0, sjis, jis, off;
static int off_table[ ] = {
128, 128+94, 128+94* 2, 128+94* 3,
128+94* 4, 128+94* 5, 128+94* 6, 128+94* 7,
128+94* 8, 128+94* 9, 128+94*10, 128+94*11,
128+94*12, 128+94*13, 128+94*14,
1538+94* 0, 1538+94* 1, 1538+94* 2, 1538+94* 3,
1538+94* 4, 1538+94* 5, 1538+94* 6, 1538+94* 7,
1538+94* 8, 1538+94* 9, 1538+94*10, 1538+94*11,
1538+94*12, 1538+94*13, 1538+94*14, 1538+94*15,
1538+94*16, 1538+94*17, 1538+94*18, 1538+94*19,
1538+94*20, 1538+94*21, 1538+94*22, 1538+94*23,
1538+94*24, 1538+94*25, 1538+94*26, 1538+94*27,
1538+94*28, 1538+94*29, 1538+94*30, 1538+94*31 };
static struct {
char *ptn;
short ds, x1, y1, x2, y2;
} font_1 = { buff, 0x14, 0, 0, 0, 0 };
static struct {
short x, y, n;
char m[ 3 ];
} font_2 = { 0, 0, 2, 0, 0, 0 };
font_1.y1 = y * 12;
font_1.y2 = y * 12 + 11;
font_2.y = y * 12 + 11;
while( *s ){
sjis = *( s + 1 ) + *s * 256;
jis = FNT_sjisToJis( sjis );
// 2水ならBIOSを使って表示
if( jis>=0x5000 ){
font_2.x = x*12+i*12;
font_2.m[ 0 ] = *s;
font_2.m[ 1 ] = *( s+1 );
EGB_textZoom( egbwork, 1, 12, 12 );
EGB_sjisString( egbwork, ( char *)&font_2 );
}
else{
off = off_table[ ( jis - 0x2121 )/0x100 ];
font_1.ptn = buff + ( off+( jis % 0x100 )-0x21 )*24;
font_1.x1 = x*12+i*12;
font_1.x2 = x*12+i*12+15;
EGB_putBlockColor( egbwork, 0, ( char *)&font_1 );
}
i++;
s += 2;
}
}